<?php
require_once('__common.php');
    require_once('__common.php');
    include_once("$g4[path]/lib/outlogin.lib.php");

$outlogin = outlogin('ebvill');

   $sql = "SELECT * FROM course ORDER BY bannerfile DESC limit 12";
   $res = mysql_query($sql);
   $data = array();
   $i = 0;
   while(($temp = mysql_fetch_assoc($res)) || $i < 16){
        if($i % 4 == 0 && $i) {
            $data[] = $temp2; 
            $temp2 = array();
        }
        if($temp['bannerfile']) {
                $temp2[] = array('banner' => "/data/courseBanner/{$temp['bannerfile']}",'bookcode'=>$temp['bookcode']); 
        } else {
                $temp2[]  = array('banner'=>'images/event_banner_02.gif', 'link'=>'/');
        }
           $i++;
   }

$tpl->print_('basic');
